#!/usr/bin/env python

import wx
from .._base import Base

class Viewer(Base):
    
    def bind(self):
        super(Viewer, self).bind()
        view = self.view
        tool = view.ToolBar
        
        view.canvas.Bind(wx.EVT_MOTION, self.onMotion)
        view.Bind(wx.EVT_MENU, self.open, tool.open.tool)
        
    def onMotion(self, event):
        self.presenter.move(event.Position)
        event.Skip()
    
    def open(self, event):
        self.presenter.open()
        event.Skip()